Optimal. Leaf size=90 \[ -\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac{i \tan ^2(c+d x)}{a d}+\frac{3 \tan (c+d x)}{2 a d}-\frac{2 i \log (\cos (c+d x))}{a d}-\frac{3 x}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0942289, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3550, 3528, 3525, 3475} \[ -\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac{i \tan ^2(c+d x)}{a d}+\frac{3 \tan (c+d x)}{2 a d}-\frac{2 i \log (\cos (c+d x))}{a d}-\frac{3 x}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3550
Rule 3528
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int \frac{\tan ^4(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{\int \tan ^2(c+d x) (3 a-4 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac{i \tan ^2(c+d x)}{a d}-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{\int \tan (c+d x) (4 i a+3 a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac{3 x}{2 a}+\frac{3 \tan (c+d x)}{2 a d}-\frac{i \tan ^2(c+d x)}{a d}-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{(2 i) \int \tan (c+d x) \, dx}{a}\\ &=-\frac{3 x}{2 a}-\frac{2 i \log (\cos (c+d x))}{a d}+\frac{3 \tan (c+d x)}{2 a d}-\frac{i \tan ^2(c+d x)}{a d}-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end{align*}
Mathematica [B] time = 1.71953, size = 196, normalized size = 2.18 \[ \frac{\cos (c) \sec (c+d x) (\cos (d x)+i \sin (d x)) \left (-8 d x \tan ^2(c)+(-8-8 i \tan (c)) \tan ^{-1}(\tan (d x))+2 i d x \tan (c)+8 d x \sec ^2(c)-2 i \sec ^2(c+d x)-i \tan (c) \sin (2 d x)-4 i \log \left (\cos ^2(c+d x)\right )+(\tan (c)+i) \cos (2 d x)+2 \tan (c) \sec ^2(c+d x)+4 \sec (c) \sin (d x) \sec (c+d x)+4 \tan (c) \log \left (\cos ^2(c+d x)\right )+4 i \tan (c) \sec (c) \sin (d x) \sec (c+d x)-6 d x+\sin (2 d x)\right )}{4 d (a+i a \tan (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.022, size = 89, normalized size = 1. \begin{align*}{\frac{\tan \left ( dx+c \right ) }{ad}}-{\frac{{\frac{i}{2}} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{ad}}+{\frac{{\frac{7\,i}{4}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{ad}}+{\frac{1}{2\,ad \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{ad}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.32047, size = 409, normalized size = 4.54 \begin{align*} -\frac{14 \, d x e^{\left (6 i \, d x + 6 i \, c\right )} +{\left (28 \, d x - i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} +{\left (14 \, d x - 10 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} -{\left (-8 i \, e^{\left (6 i \, d x + 6 i \, c\right )} - 16 i \, e^{\left (4 i \, d x + 4 i \, c\right )} - 8 i \, e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i}{4 \,{\left (a d e^{\left (6 i \, d x + 6 i \, c\right )} + 2 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.99891, size = 117, normalized size = 1.3 \begin{align*} - \frac{\left (\begin{cases} 7 x e^{2 i c} - \frac{i e^{- 2 i d x}}{2 d} & \text{for}\: d \neq 0 \\x \left (7 e^{2 i c} - 1\right ) & \text{otherwise} \end{cases}\right ) e^{- 2 i c}}{2 a} - \frac{2 i \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} + \frac{2 i e^{- 4 i c}}{a d \left (e^{4 i d x} + 2 e^{- 2 i c} e^{2 i d x} + e^{- 4 i c}\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 2.32367, size = 117, normalized size = 1.3 \begin{align*} -\frac{-\frac{7 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} - \frac{i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} + \frac{2 \,{\left (i \, a \tan \left (d x + c\right )^{2} - 2 \, a \tan \left (d x + c\right )\right )}}{a^{2}} - \frac{-7 i \, \tan \left (d x + c\right ) - 5}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]